﻿@{
    
}

<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Web Pages CMS Admin</title>
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" media="screen" />
    <link href="~/Content/font-awesome.min.css" rel="stylesheet" media="screen" />
    <link href="~/Content/datetimepicker.css" rel="stylesheet" media="screen" />
    <link href="~/Content/admin.css" rel="stylesheet" media="screen" />
</head>
<body>
    <div class="container">
        <div class="row" id="admin-head">
            <header>
                <div id="logged-in">
                    @if (WebSecurity.IsAuthenticated) {
                        <span>You are logged in as @WebSecurity.CurrentUserName | <a href="~/Admin/Logout">Logout</a></span>                
                    }
                </div>
                <h2>Control Panel</h2>
            </header>
        </div>

        <div class="row" id="admin-nav">
            <div class="span3">
                <div id="admin-site">
                    <i class="icon-globe"></i><a href="~/">Site</a>
                </div>
                <nav>
                    @if (WebSecurity.IsAuthenticated) {
                        <ul class="vertical">
                            @if (Permissions.User(Can.AddPage)) {
                                <li><i class="icon-file"></i><a href="~/Admin/Pages/Page">New Page</a></li>
                            }
                            @if (Permissions.User(Can.EditPage, Can.DeletePage, Can.ArchivePage, Can.PublishPage)) {
                                <li><i class="icon-edit"></i><a href="~/Admin/Pages/List">Edit Page</a></li>
                            }
                            @if (Permissions.User(Can.AddLayer)) {
                                <li><i class="icon-tasks"></i><a href="~/Admin/Layers/AddLayer">Add Layer</a></li>
                            }
                            @if (Permissions.User(Can.ManagePagesInLayer)) {
                                <li><i class="icon-wrench"></i><a href="~/Admin/Layers/ManageLayers">Manage Layers</a></li>
                            }
                            @if (Permissions.User(Can.AddMenu)) {
                                <li><i class="icon-th-list"></i><a href="~/Admin/Menus/AddMenu">Add Menu</a></li>
                            }
                            @if (Permissions.User(Can.AddItemsToMenu, Can.DeleteItemsFromMenu, Can.EditMenuItems)) {
                                <li><i class="icon-list-alt"></i><a href="~/Admin/Menus/MenuManager">Manage Menu Items</a></li>
                            }
                            @if (Permissions.User(Can.PlaceMenus)) {
                                <li><i class="icon-th-list"></i><a href="~/Admin/Menus/ManageMenuWidget">Place Menu Widgets</a></li>
                            }
                            @if (Permissions.User(Can.AddHtmlWidget)) {
                                <li><i class="icon-cog"></i><a href="~/Admin/Widgets/AddHtmlWidget">Add HTML Widget</a></li>
                            }
                            @if (Permissions.User(Can.PlaceHtmlWidgets)) {
                                <li><i class="icon-cogs"></i><a href="~/Admin/Widgets/ManageHtmlWidget">Place Html Widgets</a></li>
                            }
                            @if (Permissions.User(Can.CreateEmailForms)) {
                                <li><i class="icon-envelope"></i><a href="~/Admin/Widgets/AddFormWidget">Add Form Widget</a></li>
                            }
                            @if (Permissions.User(Can.AddItemsToMenu, Can.DeleteItemsFromMenu, Can.EditMenuItems)) {
                                <li><i class="icon-th"></i><a href="~/Admin/Widgets/FormManager">Manage Form Items</a></li>
                            }
                            @if (Permissions.User(Can.PlaceFormWidgets)) {
                                <li><i class="icon-envelope-alt"></i><a href="~/Admin/Widgets/ManageFormWidget">Place Form Widgets</a></li>
                            }
                            @if (Permissions.User(Can.PlaceFolders)) {
                                <li><i class="icon-folder-close"></i><a href="~/Admin/Widgets/ManageFolderWidget">Place Folder Widgets</a></li>
                            }
                            @if (Permissions.User(Can.EditFormItems, Can.EditHtmlWidget, Can.EditMenuItems, Can.RemoveWidgets)) {
                                <li><i class="icon-asterisk"></i><a href="~/Admin/Widgets/ManageWidgets">Manage Placed Widgets</a></li>
                            }
                            @if (Permissions.User(Can.CreateMediaFolder, Can.UploadMedia, Can.DeleteMediaFolder)) {
                                <li><i class="icon-picture"></i><a href="~/Admin/Media/ManageMedia">Manage Media</a></li>
                            }
                            @if (Permissions.User(Can.CreateUser)) {
                                <li><i class="icon-user"></i><a href="~/Admin/Users/AddUser">Add User</a></li>
                            }
                            @if (Permissions.User(Can.EditMenuItems, Can.DeleteUser)) {
                                <li><i class="icon-group"></i><a href="~/Admin/Users/List">Manage User</a></li>
                            }
                            @if (Permissions.User(Can.CreateRole)) {
                                <li><i class="icon-random"></i><a href="~/Admin/Users/AddRole">Add Role</a></li>
                            }
                            @if (Permissions.User(Can.ManageRolesPermissions)) {
                                <li><i class="icon-lock"></i><a href="~/Admin/Users/RolePermissions">Manage Role Permissions</a></li>
                            }
                        </ul>
                    }
                </nav>
            </div>

            <div class="span9" id="admin-content">
                @RenderBody()
            </div>
        </div>

        <div class="row" id="admin-foot">
            <footer>
                &copy; @DateTime.Now.Year Web Pages CMS v 0.5.0.1
            </footer>
        </div>
    </div>
    <script src="~/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="~/Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
    <script src="~/Scripts/bootstrap.min.js" type="text/javascript"></script>
    @RenderSection("Script", required: false)
</body>
</html>
